<?php
	$root = $_SERVER['DOCUMENT_ROOT'];
	include($root . "/util/session.php");
	include($root . "/util/privilege_check.php");
	checkPrivilege("admin");
	$degreeID=mysqli_real_escape_string($db,$_GET['degreeID']);
	$sql="delete from subjects where degreeID='$degreeID';delete from degrees where degreeID='$degreeID';delete from students_subjects where degreeID='$degreeID'";
	$result=mysqli_multi_query($db,$sql);
	header("Refresh:3; url=/admin/degreeList.php");
	if($result){
		echo "<h1>Degree and subjects deleted, hope it wasn't a misclick...going back in 3 seconds...<h1>";
	}
	else{
		echo '<h1>Degree not deleted, going back in 3 seconds...<h1>';
	}
?>
